#ifndef __TOUCH_XPT2406_H
#define __TOUCH_XPT2406_H
#include "stdlib.h"
#include "lcd_port.h"


#define TOUCH_USE_XPT2046      1

#if TOUCH_USE_XPT2046
#define TOUCH_X_MIN 290
#define TOUCH_X_MAX 3820
#define TOUCH_Y_MIN 225
#define TOUCH_Y_MAX 3700
#endif

#define TOUCH_EVENT_UP      (0x01)
#define TOUCH_EVENT_DOWN    (0x02)
#define TOUCH_EVENT_MOVE    (0x03)
#define TOUCH_EVENT_NONE    (0x80)
struct touch_message
{
    rt_uint16_t x;
    rt_uint16_t y;
    rt_uint8_t event;
};

void touch_init(void);
void touch_test(void);
int touch_read_status(struct touch_message *msg);

#endif





